﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:controls="clr-namespace:WhiteFlow.DevTrackingTool.UI.Controls"
                    xmlns:wfControls="clr-namespace:WhiteFlow.Wpf.Controls.Common;assembly=WhiteFlow.Wpf.Controls">

    <!--Control colors.-->
    <Color x:Key="WindowColor">#FFE8EDF9</Color>
    <Color x:Key="ContentAreaColorLight">#FFC5CBF9</Color>
    <Color x:Key="ContentAreaColorDark">#FF7381F9</Color>

    <Color x:Key="DisabledControlLightColor">#FFE8EDF9</Color>
    <Color x:Key="DisabledControlDarkColor">#FFC5CBF9</Color>
    <Color x:Key="DisabledForegroundColor">#FF888888</Color>

    <Color x:Key="SelectedBackgroundColor">#FFC5CBF9</Color>
    <Color x:Key="SelectedUnfocusedColor">#FFDDDDDD</Color>

    <Color x:Key="ControlLightColor">White</Color>
    <Color x:Key="ControlMediumColor">#FF7381F9</Color>
    <Color x:Key="ControlDarkColor">#FF211AA9</Color>

    <Color x:Key="ControlMouseOverColor">#FF3843C4</Color>
    <Color x:Key="ControlPressedColor">#FF211AA9</Color>


    <Color x:Key="GlyphColor">#FF444444</Color>
    <Color x:Key="GlyphMouseOver">#FF1ea990</Color>

    <!--Border colors-->
    <Color x:Key="BorderLightColor">#FFCCCCCC</Color>
    <Color x:Key="BorderMediumColor">#FF888888</Color>
    <Color x:Key="BorderDarkColor">#FF444444</Color>

    <Color x:Key="PressedBorderLightColor">#FF888888</Color>
    <Color x:Key="PressedBorderDarkColor">#FF444444</Color>

    <Color x:Key="DisabledBorderLightColor">#FFAAAAAA</Color>
    <Color x:Key="DisabledBorderDarkColor">#FF888888</Color>

    <Color x:Key="DefaultBorderBrushDarkColor">Black</Color>

    <!--Control-specific resources.-->
    <Color x:Key="HeaderTopColor">#FFC5CBF9</Color>
    <Color x:Key="DatagridCurrentCellBorderColor">Black</Color>
    <Color x:Key="SliderTrackDarkColor">#FFC5CBF9</Color>

    <Color x:Key="NavButtonFrameColor">#FF3843C4</Color>


    <!--Style for the days of a month.-->
    <Style x:Key="CalendarDayButtonStyle" TargetType="{x:Type CalendarDayButton}">
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinHeight" Value="30" />
        <Setter Property="MinWidth" Value="30" />
        <Setter Property="FontSize" Value="12" />
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CalendarDayButton">
                    <Grid Name="Container" Cursor="Hand">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="Normal" />
                                <VisualState Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Pressed" />
                                <!--<VisualState Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                             Storyboard.TargetProperty="Opacity"
                                                             To="0.5"
                                                             Duration="0" />
                                        </Storyboard>
                                    </VisualState>-->
                                <VisualState Name="Disabled" />
                                <!--<VisualState Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                                             Storyboard.TargetProperty="Opacity"
                                                             To="0"
                                                             Duration="0" />
                                            <DoubleAnimation Storyboard.TargetName="NormalText"
                                                             Storyboard.TargetProperty="Opacity"
                                                             To=".35"
                                                             Duration="0" />
                                        </Storyboard>
                                    </VisualState>-->
                            </VisualStateGroup>
                            <VisualStateGroup Name="SelectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="Unselected" />
                                <VisualState Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="SelectedBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup Name="CalendarButtonFocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="CalendarButtonFocused" />
                                <!--<VisualState Name="CalendarButtonFocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DayButtonFocusVisual"
                                                                           Storyboard.TargetProperty="Visibility"
                                                                           Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>-->
                                <VisualState Name="CalendarButtonUnfocused" />
                                <!--<VisualState Name="CalendarButtonUnfocused">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="DayButtonFocusVisual"
                                                                           Storyboard.TargetProperty="Visibility"
                                                                           Duration="0">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>-->
                            </VisualStateGroup>
                            <VisualStateGroup Name="ActiveStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="Active" />
                                <VisualState Name="Inactive">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="DayBorder"
                                                        Storyboard.TargetProperty="Background.GradientStops[0].Color"
                                                        To="Transparent"
                                                        Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="DayBorder"
                                                        Storyboard.TargetProperty="Background.GradientStops[1].Color"
                                                        To="Transparent"
                                                        Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="DayBorder"
                                                        Storyboard.TargetProperty="Background.GradientStops[2].Color"
                                                        To="Transparent"
                                                        Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="DayBorder"
                                                        Storyboard.TargetProperty="Background.GradientStops[3].Color"
                                                        To="Transparent"
                                                        Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="DayBorder"
                                                        Storyboard.TargetProperty="Background.GradientStops[4].Color"
                                                        To="Transparent"
                                                        Duration="0" />
                                        <DoubleAnimation Storyboard.TargetName="Container"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="0.4"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup Name="DayStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="RegularDay" />
                                <VisualState Name="Today">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="TodayBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To="1"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup Name="BlackoutDayStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="NormalDay" />
                                <VisualState Name="BlackoutDay" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border x:Name="DayBorder"
                                Background="{StaticResource ResourceKey=CalendarDaysMainBgBrush}"
                                BorderThickness="1"
                                BorderBrush="Transparent" />

                        <Border BorderThickness="1" BorderBrush="Transparent">
                            <Rectangle x:Name="TodayBackground"
                                   RadiusX="1"
                                   RadiusY="1"
                                   Opacity="0"
                                   Fill="#FF9ca8b7" />
                        </Border>

                        <Border BorderThickness="1" BorderBrush="Transparent">
                            <Rectangle x:Name="SelectedBackground"
                                   RadiusX="1"
                                   RadiusY="1"
                                   Opacity="0"
                                   Fill="#FFeda314" />
                        </Border>

                        <Border BorderThickness="1" BorderBrush="Transparent">
                            <Rectangle x:Name="HighlightBackground"
                                   RadiusX="1"
                                   RadiusY="1"
                                   Opacity="0"
                                   Fill="{StaticResource ResourceKey=CalendarDaysHoverBgBrush}" />
                        </Border>
                        
                        <Grid VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>

                            <Border Background="{StaticResource ResourceKey=CalendarDaysNmbersBgBrush}"
                                    Margin="1,5,0,5"
                                    Padding="2"
                                    MinWidth="35"
                                    CornerRadius="0,8,8,0">
                                <ContentPresenter x:Name="NormalText"
                                                  TextElement.FontFamily="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Fonts/#BIRTH OF A HERO"
                                                  TextElement.Foreground="{StaticResource ResourceKey=CalendarDaysFgColor}"
                                                  TextElement.FontSize="20"
                                                  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                                  VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                                  Margin="5" />
                            </Border>
                            
                            <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Margin="5,0,0,0">
                                <Border x:Name="PART_TrackedTasksIcon"
                                        Visibility="Collapsed"
                                        ToolTip="There are tracked tasks in this day">
                                    <wfControls:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Calendar/table_edit.png" />
                                </Border>
                                <Border x:Name="PART_Test1TaskIcon"
                                        Visibility="Collapsed"
                                        ToolTip="Test">
                                    <wfControls:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Calendar/Application.png" />
                                </Border>
                                <Border x:Name="PART_Test2TaskIcon"
                                        Visibility="Collapsed"
                                        ToolTip="Test">
                                    <wfControls:Bitmap Source="/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Calendar/Lock.png" />
                                </Border>
                            </StackPanel>
                        </Grid>
                        
                        <!--<Path x:Name="Blackout"
                              Opacity="0"
                              Margin="3"
                              HorizontalAlignment="Stretch"
                              VerticalAlignment="Stretch"
                              RenderTransformOrigin="0.5,0.5"
                              Fill="#FF000000"
                              Stretch="Fill"
                              Data="M8.1772461,11.029181 L10.433105,
                                    11.029181 L11.700684,12.801641 L12.973633,
                                    11.029181 L15.191895,11.029181 L12.844727
                                    13.999395 L15.21875,17.060919 L12.962891,
                                    17.060919 L11.673828,15.256231 L10.352539,
                                    17.060919 L8.1396484,17.060919 L10.519043,
                                    14.042364 z" />-->
                        <!--<Rectangle x:Name="DayButtonFocusVisual"
                                   Visibility="Collapsed"
                                   IsHitTestVisible="false"
                                   RadiusX="1"
                                   RadiusY="1">
                            <Rectangle.Stroke>
                                <SolidColorBrush Color="{DynamicResource SelectedBackgroundColor}" />
                            </Rectangle.Stroke>
                        </Rectangle>-->
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--Style for the months of a year and years of a decade.-->
    <Style x:Key="CalendarButtonStyle" TargetType="CalendarButton">
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinHeight" Value="42" />
        <Setter Property="MinWidth" Value="40" />
        <Setter Property="FontSize" Value="10" />
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="CalendarButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup Name="CommonStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0:0:0.1" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="Normal" />
                                <VisualState Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Background"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To=".5"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Background"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To=".5"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup Name="SelectionStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="Unselected" />
                                <VisualState Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="SelectedBackground"
                                                         Storyboard.TargetProperty="Opacity"
                                                         To=".75"
                                                         Duration="0" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup Name="ActiveStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="Active" />
                                <VisualState Name="Inactive">
                                    <Storyboard>
                                        <ColorAnimation Duration="0"
                                                        Storyboard.TargetName="NormalText"
                                                        Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)"
                                                        To="#FF777777" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup Name="CalendarButtonFocusStates">
                                <VisualStateGroup.Transitions>
                                    <VisualTransition GeneratedDuration="0" />
                                </VisualStateGroup.Transitions>
                                <VisualState Name="CalendarButtonFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Duration="0"
                                                 Storyboard.TargetName="CalendarButtonFocusVisual"
                                                 Storyboard.TargetProperty="Visibility">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState Name="CalendarButtonUnfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Rectangle x:Name="SelectedBackground"
                     RadiusX="1"
                     RadiusY="1"
                     Opacity="0">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{DynamicResource SelectedBackgroundColor}" />
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle x:Name="Background"
                     RadiusX="1"
                     RadiusY="1"
                     Opacity="0">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{DynamicResource SelectedBackgroundColor}" />
                            </Rectangle.Fill>
                        </Rectangle>
                        <ContentPresenter x:Name="NormalText"
                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                            Margin="1,0,1,1">
                            <TextElement.Foreground>
                                <SolidColorBrush Color="#FF333333" />
                            </TextElement.Foreground>
                        </ContentPresenter>
                        <Rectangle x:Name="CalendarButtonFocusVisual"
                     Visibility="Collapsed"
                     IsHitTestVisible="false"
                     RadiusX="1"
                     RadiusY="1">
                            <Rectangle.Stroke>
                                <SolidColorBrush Color="{DynamicResource SelectedBackgroundColor}" />
                            </Rectangle.Stroke>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{DynamicResource ControlMediumColor}" />
            </Setter.Value>
        </Setter>
    </Style>

    <!--Button to go to the previous month or year.-->
    <ControlTemplate x:Key="PreviousButtonTemplate" TargetType="{x:Type Button}">
        <Border Cursor="Hand">
            <!--<VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation Duration="0" 
                                            Storyboard.TargetName="path"
                                            Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                                            To="{DynamicResource GlyphMouseOver}" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             To=".5"
                                             Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)"
                                             Storyboard.TargetName="path" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>-->
            <!--<Path x:Name="path"
                    Margin="14,-6,0,0"
                    Stretch="Fill"
                    HorizontalAlignment="Left"
                    Height="10"
                    VerticalAlignment="Center"
                    Width="6"
                    Data="M288.75,232.25 L288.75,240.625 L283,236.625 z"
                    Fill="#720909" />-->
            <wfControls:Bitmap Source="pack://application:,,,/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Calendar/previous.png" />
        </Border>
    </ControlTemplate>

    <!--Button to go to the next month or year.-->
    <ControlTemplate x:Key="NextButtonTemplate" TargetType="{x:Type Button}">
        <!--<Grid Cursor="Hand">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ColorAnimation Duration="0"
                            To="{StaticResource GlyphMouseOver}"
                            Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)"
                            Storyboard.TargetName="path" />
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                             To=".5"
                             Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)"
                             Storyboard.TargetName="path" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>
            <Path x:Name="path"
                  Data="M282.875,231.875 L282.875,240.375 L288.625,236 z"
                  HorizontalAlignment="Right"
                  Height="10"
                  Margin="0,-6,14,0"
                  Stretch="Fill"
                  VerticalAlignment="Center"
                  Width="6"
                  Fill="#720909" />
        </Grid>-->
        <Border x:Name="IconBorder" Cursor="Hand">
            <!--<VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="1"
                                                           Storyboard.TargetName="Icon"
                                                           Storyboard.TargetProperty="Source">
                                <DiscreteObjectKeyFrame KeyTime="00:00:01.000" Value="pack://application:,,,/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Calendar/next.png" />
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                             To=".5"
                             Storyboard.TargetProperty="(Shape.Fill).(Brush.Opacity)"
                             Storyboard.TargetName="path" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>-->
            
            <wfControls:Bitmap x:Name="Icongh" Source="pack://application:,,,/WhiteFlow.DevTrackingTool.UI;Component/Resources/Icons/Calendar/next.png" />
        </Border>
    </ControlTemplate>

    <!--Button to go up a level to the year or decade.-->
    <ControlTemplate x:Key="HeaderButtonTemplate" TargetType="{x:Type Button}">
        <Grid Cursor="Hand">
            <VisualStateManager.VisualStateGroups>
                <VisualStateGroup x:Name="CommonStates">
                    <VisualState x:Name="Normal" />
                    <VisualState x:Name="MouseOver">
                        <Storyboard>
                            <ObjectAnimationUsingKeyFrames Duration="0"
                                                           BeginTime="00:00:00.000"
                                                           Storyboard.TargetName="buttonContent"
                                                           Storyboard.TargetProperty="BitmapEffect">
                                <ObjectAnimationUsingKeyFrames.KeyFrames>
                                    <DiscreteObjectKeyFrame KeyTime="00:00:00.000">
                                        <DiscreteObjectKeyFrame.Value>
                                            <DropShadowBitmapEffect ShadowDepth="3" Color="White" />
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames.KeyFrames>
                            </ObjectAnimationUsingKeyFrames>
                        </Storyboard>
                    </VisualState>
                    <VisualState x:Name="Disabled">
                        <Storyboard>
                            <DoubleAnimation Duration="0"
                                             To=".5"
                                             Storyboard.TargetProperty="Opacity"
                                             Storyboard.TargetName="buttonContent" />
                        </Storyboard>
                    </VisualState>
                </VisualStateGroup>
            </VisualStateManager.VisualStateGroups>

            <ContentPresenter x:Name="buttonContent"
                              TextElement.Foreground="#FF343434"
                              TextElement.FontFamily="pack://application:,,,/WhiteFlow.DevTrackingTool.UI;Component/Resources/Fonts/#BIRTH OF A HERO"
                              TextElement.FontSize="30"
                              Margin="1,4,1,9"
                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                              ContentTemplate="{TemplateBinding ContentTemplate}"
                              Content="{TemplateBinding Content}" />
        </Grid>
    </ControlTemplate>

    <Style x:Key="CalendarItemStyle" TargetType="{x:Type CalendarItem}">
        <Setter Property="Margin" Value="0,3,0,3" />
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CalendarItem}">
                    <ControlTemplate.Resources>
                        <DataTemplate x:Key="{x:Static CalendarItem.DayTitleTemplateResourceKey}">
                            <Border Background="{StaticResource ResourceKey=CalendarDaysHeaderBgBrush}" 
                                    CornerRadius="4,4,0,0" 
                                    BorderThickness="1" 
                                    BorderBrush="Transparent">
                                <TextBlock Foreground="{StaticResource ResourceKey=CalendarDaysHeaderFgBrush}"
                                           FontWeight="Bold"
                                           FontFamily="pack://application:,,,/WhiteFlow.DevTrackingTool.UI;Component/Resources/Fonts/#BIRTH OF A HERO"
                                           FontSize="25"
                                           Text="{Binding}"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center" />
                            </Border>
                        </DataTemplate>
                    </ControlTemplate.Resources>

                    <Border x:Name="PART_Root">
                        <Border.Resources>
                            <SolidColorBrush x:Key="DisabledColor" Color="#A5FFFFFF" />
                        </Border.Resources>

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0"
                                                         To="1"
                                                         Storyboard.TargetProperty="Opacity"
                                                         Storyboard.TargetName="PART_DisabledVisual" />
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>

                        <Border BorderThickness="0" CornerRadius="1">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto" />
                                    <RowDefinition Height="*" />
                                </Grid.RowDefinitions>
                                
                                <Grid Grid.Row="0" Grid.ColumnSpan="3" Margin="6,2,6,2">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="auto" />
                                        <ColumnDefinition Width="*" />
                                        <ColumnDefinition Width="auto" />
                                    </Grid.ColumnDefinitions>
                                    
                                    <Button x:Name="PART_PreviousButton"
                                            Focusable="False"
                                            VerticalAlignment="Center"
                                            Template="{StaticResource PreviousButtonTemplate}"/>

                                    <Button x:Name="PART_HeaderButton"
                                            FontWeight="Bold"
                                            Focusable="False"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Center"
                                            Grid.Column="1"
                                            Template="{StaticResource HeaderButtonTemplate}" />

                                    <Button x:Name="PART_NextButton"
                                            Grid.Column="2"
                                            Focusable="False"
                                            VerticalAlignment="Center"
                                            Template="{StaticResource NextButtonTemplate}" />
                                </Grid>

                                <Grid x:Name="PART_MonthView"
                                      Grid.ColumnSpan="3"
                                      Grid.Row="1"
                                      Visibility="Visible"
                                      Margin="6,-1,6,6">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="14*" />
                                        <ColumnDefinition Width="14*" />
                                        <ColumnDefinition Width="15*" />
                                        <ColumnDefinition Width="14*" />
                                        <ColumnDefinition Width="15*" />
                                        <ColumnDefinition Width="14*" />
                                        <ColumnDefinition Width="14*" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="14*" />
                                        <RowDefinition Height="14*" />
                                        <RowDefinition Height="15*" />
                                        <RowDefinition Height="14*" />
                                        <RowDefinition Height="15*" />
                                        <RowDefinition Height="14*" />
                                        <RowDefinition Height="14*" />
                                    </Grid.RowDefinitions>
                                </Grid>
                                
                                <Grid x:Name="PART_YearView"
                                          Visibility="Hidden"
                                          Grid.ColumnSpan="3"
                                          Grid.Row="1"
                                          HorizontalAlignment="Center"
                                          Margin="6,-3,7,6">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="Auto" />
                                    </Grid.RowDefinitions>
                                </Grid>
                            </Grid>
                        </Border>
                        <!--<Rectangle x:Name="PART_DisabledVisual"
                                   Fill="{StaticResource DisabledColor}"
                                   Opacity="0"
                                   RadiusY="2"
                                   RadiusX="2"
                                   Stretch="Fill"
                                   Stroke="{StaticResource DisabledColor}"
                                   StrokeThickness="1"
                                   Visibility="Collapsed" />-->
                        <!--</Grid>-->
                    </Border>

                    <ControlTemplate.Triggers>
                        <!--<Trigger Property="IsEnabled" Value="False">
                            <Setter Property="Visibility" TargetName="PART_DisabledVisual" Value="Visible" />
                        </Trigger>-->
                        <DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" Value="Year">
                            <Setter Property="Visibility" TargetName="PART_MonthView" Value="Hidden" />
                            <Setter Property="Visibility" TargetName="PART_YearView" Value="Visible" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding DisplayMode, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" Value="Decade">
                            <Setter Property="Visibility" TargetName="PART_MonthView" Value="Hidden" />
                            <Setter Property="Visibility" TargetName="PART_YearView" Value="Visible" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type controls:TrackingCalendar}">
        <Setter Property="CalendarButtonStyle" Value="{StaticResource CalendarButtonStyle}" />
        <Setter Property="CalendarDayButtonStyle" Value="{StaticResource CalendarDayButtonStyle}" />
        <Setter Property="CalendarItemStyle" Value="{StaticResource CalendarItemStyle}" />
        <Setter Property="Foreground" Value="#FFFFFFFF" />
        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type controls:TrackingCalendar}">
                    
                    <Border x:Name="PART_Root">
                        <CalendarItem x:Name="PART_CalendarItem"
                                      BorderBrush="{TemplateBinding BorderBrush}"
                                      BorderThickness="{TemplateBinding BorderThickness}"
                                      Background="{TemplateBinding Background}"
                                      Style="{TemplateBinding CalendarItemStyle}" />
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>